package com.sunrise.generico.repositorio;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.criterion.Order;
import org.springframework.stereotype.Repository;

import com.sunrise.generico.acesso.DaoNegocioService;
import com.sunrise.generico.entidade.DestinatarioSMS;
import com.sunrise.generico.repositorio.iface.DestinatarioSMSDao;

@Repository
public class DestinatarioSMSDaoImpl extends DaoNegocioService<DestinatarioSMS> implements
		DestinatarioSMSDao {

	@SuppressWarnings("unchecked")
	public List<DestinatarioSMS> listarOrdenado() {
		Criteria crit = getSession().createCriteria(DestinatarioSMS.class);
		crit.addOrder(Order.asc("nome"));
		return crit.list();
	}

	public DestinatarioSMS getById(Long id) {
		return getById(id, DestinatarioSMS.class);
	}


}
